package main

import (
    "github.com/garyburd/redigo/redis"
    "fmt"
)


var Pool redis.Pool

func init()  {      //init 用于初始化一些参数，先于main执行
    Pool = redis.Pool{
        MaxIdle:     160,
        MaxActive:   500,
        IdleTimeout: 120,
        Wait :true,
        Dial: func() (redis.Conn, error) {
            return redis.Dial("tcp", "127.0.0.1:6379")
        },
    }
}



func main()  {

    rc :=Pool.Get()
    //_,err := conn.Do("HSET","student",key, key)
    reply, err := redis.String(rc.Do("RPOP", "name"))
    if err != nil {
        if err != redis.ErrNil {
            fmt.Println("get SmsDto fail", err)
        }
        //返回空值
        fmt.Println(111111)
        fmt.Println(reply)
        return
    }

    if reply == "" || reply == "nil" {
        fmt.Println(22222)
    }
    fmt.Println(33333)
    fmt.Println(reply)
}


